package com.itasura.strategy;

/**
 * 老司机
 * @author sailor wang
 * @date 2018/8/27 下午12:45
 * @description
 */
public class Driver {
    private VehicleStrategy vehicleStrategy;

    public Driver(VehicleStrategy vehicleStrategy) {
        this.vehicleStrategy = vehicleStrategy;
    }

    public void changeStrategy(VehicleStrategy vehicleStrategy){
        this.vehicleStrategy = vehicleStrategy;
    }

    public void drive(){
        vehicleStrategy.run();
    }
}